//
//  DevelopPartyerController.m
//  UESTCPioneer
//
//  Created by Apple on 14-9-25.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "DevelopPartyerController.h"

@interface DevelopPartyerController ()<UIScrollViewDelegate>
{
    UIImageView * _imageView;
    UIScrollView * _scrollView;
}
@end

@implementation DevelopPartyerController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setImage];
    self.view.backgroundColor = [UIColor colorWithRed:232.0f/255.0f green:233.0f/255.0f blue:232.0f/255.0f alpha:1];
    self.title = @"入党流程";
}

#pragma mark -添加UIImageView
-(void)setImage{
    CGFloat x = self.view.frame.size.width;
    CGFloat y = self.view.frame.size.height;
    
    //1.添加UIScrollView
    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, x, y - 44)];
    [_scrollView setBackgroundColor:[UIColor colorWithRed:232.0f/255.0f green:233.0f/255.0f blue:232.0f/255.0f alpha:1]];
    [_scrollView setDelegate:self];
    [_scrollView setShowsHorizontalScrollIndicator:NO];
    [_scrollView setShowsVerticalScrollIndicator:NO];
    [_scrollView setMaximumZoomScale:2.0];
    
    //2.添加UIImageView
    UIImage * image = [UIImage imageNamed:@"developPartyer.png"];
    _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, x, y - 44)];
    [_imageView setImage:image];
    
    //3.设置UIScrollView
    [_scrollView setContentSize:_imageView.frame.size];
    [_scrollView setMinimumZoomScale:_scrollView.frame.size.width / _imageView.frame.size.width];
    [_scrollView setZoomScale:_scrollView.minimumZoomScale];
    [_scrollView addSubview:_imageView];
    [self.view addSubview:_scrollView];
}

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
	return _imageView;
}
@end
